package com.company.service.impl;

import com.company.entity.User;
import com.company.service.LoginService;
import com.company.servlet.UserServlet;

import java.util.Scanner;

public class LoginServiceImpl implements LoginService {
        Scanner sc=new Scanner(System.in);
    @Override
    public void execute() {
        System.out.println("请输入登录名");
        String name=sc.next();
        System.out.println("请输入密码");
        String pswd=sc.next();
        User user= StartServiceImpl.userService.login(name,pswd);
        if (user!=null){
            System.out.println("登陆成功");
        }else{
            System.out.println("登陆失败,账户或密码错误");
        }
    }
}
